package com.ctshk.rpc.user.req;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * <p>
 *  修改密码req
 * </p>
 *
 * @author 李新科
 * @date 2021/4/22 9:10
 */
@Data
@ApiModel
public class UpdatePwdReq implements Serializable {

    @NotBlank(message = "請輸入原密碼")
    @Pattern(message = "請輸入6-24位数字或英文字母,大小写不相等的原密码",regexp = "^[A-Za-z0-9]{6,24}$")
    @ApiModelProperty(name = "oldPassword", value = "密码", required = true)
    private String oldPassword;

    @NotBlank(message = "請輸入新密碼")
    @Pattern(message = "請輸入8-24位数字或英文字母,大小写不相等的新密码",regexp = "^[A-Za-z0-9]{8,24}$")
    @ApiModelProperty(name = "newPassword", value = "密码", required = true)
    private String newPassword;

    @NotBlank(message = "請輸入驗證碼")
    @ApiModelProperty(name = "code", value = "驗證碼", required = true)
    private String code;

    @ApiModelProperty(value="用戶Id")
    private Long userId;
}
